using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace vtpsms.dao.Models.Mapping
{
    public class CUSTOMER_INFOMap : EntityTypeConfiguration<CUSTOMER_INFO>
    {
        public CUSTOMER_INFOMap()
        {
            // Primary Key
            this.HasKey(t => t.CustomerId);

            // Properties
            this.Property(t => t.CustomerName)
                .HasMaxLength(100);

            this.Property(t => t.Telephone)
                .HasMaxLength(15);

            this.Property(t => t.Email)
                .HasMaxLength(100);

            this.Property(t => t.InterPhone)
                .HasMaxLength(15);

            // Table & Column Mappings
            this.ToTable("CUSTOMER_INFO");
            this.Property(t => t.CustomerId).HasColumnName("CustomerId");
            this.Property(t => t.CustomerName).HasColumnName("CustomerName");
            this.Property(t => t.Telephone).HasColumnName("Telephone");
            this.Property(t => t.Email).HasColumnName("Email");
            this.Property(t => t.InterPhone).HasColumnName("InterPhone");
        }
    }
}
